package com.gusto.movielens.recommendation.access;

import java.util.List;

import com.gusto.engine.colfil.Distance;
import com.gusto.engine.colfil.neighborhood.ColNeighborhoodService;
import com.gusto.engine.recommend.delagate.ColNeighborhoodDelegate;
import com.gusto.engine.recommend.delagate.NeighborhoodDelegate;

/**
 * <p>The collaborative implementation of {@link NeighborhoodDelegate} 
 * for the Colfil System.</p>
 * 
 * @author amokrane.belloui@gmail.com
 */
public class CollaborativeNeighborhoodDelegateImpl implements ColNeighborhoodDelegate {
	
	private ColNeighborhoodService collaborativeNeighborhoodService;
	public void setCollaborativeNeighborhoodService(ColNeighborhoodService collaborativeNeighborhoodService) {
		this.collaborativeNeighborhoodService = collaborativeNeighborhoodService;
	}

	public List<Distance> getNearUsers(long userId, String formula, int MIN_SHARED_ITEM, Integer MAX_NEIGHBORS, double MIN_SIMILARITY) {
		List<Distance> result = collaborativeNeighborhoodService.getNearUsers(userId, formula, MIN_SHARED_ITEM, MIN_SIMILARITY);
		return result;
	}
	
	public List<Distance> getNearItems(long itemId, String formula, int MIN_SHARED_ITEM, Integer MAX_NEIGHBORS, double MIN_SIMILARITY) {
		List<Distance> result = collaborativeNeighborhoodService.getNearItems(itemId, formula, MIN_SHARED_ITEM, MIN_SIMILARITY);
		return result;
	}
	
}

